package atguigu.neibulei;

public class Dialog {
    private int width;
    private int height;
    private int left;
    private int top;

    private Dialog(){}

    private Dialog(DialogBuilder builder){
        this.width = builder.width;
        this.height = builder.height;
        this.top = builder.top;
        this.left = builder.left;
    }


    @Override
    public String toString() {
        return "Dialog{" +
                "width=" + width +
                ", height=" + height +
                ", left=" + left +
                ", top=" + top +
                '}';
    }

    public static DialogBuilder createBuilder(){
        return new DialogBuilder();
    }


    public static class DialogBuilder{
        private int width;
        private int height;
        private int left;
        private int top;

        public DialogBuilder width(int width){
            this.width = width;
            return this;
        }

        public DialogBuilder height(int height){
            this.height = height;
            return this;
        }

        public DialogBuilder left(int left){
            this.left = left;
            return this;
        }

        public DialogBuilder top(int top){
            this.top = top;
            return this;
        }

        public Dialog build(){
            return new Dialog(this);
        }
    }
}
